Page({
  data: {
    // 定义枚举
    // <text class="tag {{statusType[status]}}">{{statusMsg[status]}}</text>
    statusMsg: {
      1: '审核中',
      2: '审核成功',
      3: '审核失败'
    },
    statusType: {
      1: 'info',
      2: 'success',
      3: 'fail'
    }
  },
  onLoad({ id }) {
    this.getHouseDetail(id)
  },
  async getHouseDetail(id) {
    if (!id) return
    const res = await wx.http.get('/room/' + id)
    // console.log(res);
    this.setData({
      ...res.data
    })
  },
  //跳转房屋编辑
  editHouse() {
    wx.navigateTo({
      url: '/house_pkg/pages/form/index?id=' + this.data.id,
    })
  },
})
